﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;



class Exercises
{
    public static void Main()
    {
        //PrintInHexadecimalNumericSystem("Hi!\t\n?^");
        //PrintInHexadecimalNumericSystem("Hello, Iva. :-P");
        //PrintIntegersFrom5To25();
        //FractionNumber fraction = new FractionNumber(12, 51);
        //Console.WriteLine(fraction);
        //Console.WriteLine("{0:N}",fraction);
        //Console.WriteLine("{0:R}", fraction);
        //PrintDate("12.12.2001");
        //PrintDate("02/05/2010"); 
        //PrintDate("05.11.06");
        //PrintDate("25/04/11");
        //double number = 34.6241;
        //Console.Write("Israel: ");
        //PrintNumber(number, new CultureInfo("he-IL"));
        //Console.Write("Bulgaria: ");
        //PrintNumber(number, new CultureInfo("bg-BG"));
        //Console.Write("Mongolian: ");
        //PrintNumber(number, new CultureInfo("mn-MN"));
        //Console.Write("Japan: ");
        //PrintNumber(number, new CultureInfo("ja-JP"));
        //Console.Write("Taiwan: ");
        //PrintNumber(number, new CultureInfo("zh-TW"));
        //Console.Write("Austria: ");
        //PrintNumber(number, new CultureInfo("de-AT"));
    }

    public static void PrintInHexadecimalNumericSystem(String s)
    {
        byte[] symbols = Encoding.UTF8.GetBytes(s);
        foreach (byte symbol in symbols)
        {
            Console.Write(String.Format("\\x{0:X}", symbol));
        }
        Console.WriteLine();
    }

    public static void PrintIntegersFrom5To25()
    {
        for (int i = 5; i <= 25; i++)
        {
            Console.Write("|{0,5}", i);
            Console.Write("|{0,-6}", i * i);
            Console.Write("|"+"{0,-10:0.0000}",Math.Sqrt(i));
            Console.WriteLine("|" + Math.Log(i));
        }
    }

    public static void PrintDate(string date)
    {
        Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
        DateTime dateTime = DateTime.Parse(date);
        Console.WriteLine("day = {0:00}, month = {1:00}, year = {2}",dateTime.Day, dateTime.Month, dateTime.Year);
    }

    public static void PrintNumber(double number, CultureInfo culture)
    {
        Thread.CurrentThread.CurrentCulture = culture;
        Console.WriteLine("{0:C}",number);
    }
}

